package com.atguigu.yygh.hosp.utils;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Set;

/**
 * @author A
 * @version 1.0
 * @description: TODO
 * @date 2025/3/16 0:26
 */
public class HttpRequestHelper {

    public static Map<String, Object> switchRequest(HttpServletRequest request) {
        Map<String, String[]> parameterMap = request.getParameterMap();
        Set<Map.Entry<String, String[]>> entries = parameterMap.entrySet();
        HashMap<String, Object> map = new HashMap<>();
        entries.forEach(entry->{
            map.put(entry.getKey(),entry.getValue()[0]);
        });
        return map;
    }
}
